home *** CD-ROM | disk | FTP | other *** search
/ Cream of the Crop 1 / Cream of the Crop 1.iso / PROGRAM / BAGOSRC.ARJ / BAGO.H < prev    next >
Text File  |  1992-02-12  |  10KB  |  356 lines

  1. #define VERSION  "Version 3.19"
  2.  
  3. /* My own Button IDs, for edit dialog box */
  4. #define ID_OK           1
  5. #define ID_CANCEL       2
  6. #define ID_SUFS         100
  7. #define ID_SUFED        101
  8. #define ID_SUFER        102
  9. #define ID_SUFING       103
  10. #define ID_SUFEN        104
  11. #define ID_SUFY         105
  12. #define ID_SUFLY        106
  13. #define ID_SUFEST       107
  14. #define ID_SUFISH       108
  15. #define ID_SUFERS       109
  16. #define ID_SUFINGS      110
  17. #define ID_SUF111       111
  18. #define ID_SUF112       112
  19. #define ID_SUF113       113
  20. #define ID_SUF114       114
  21. #define ID_SUF115       115
  22. #define ID_FIRSTSUF     ID_SUFS
  23. #define ID_LASTSUF      ID_SUFINGS
  24. #define ID_DELETE       116
  25. #define ID_FREQ         117
  26. #define ID_PREV         118
  27. #define ID_NEXT         119
  28. #define ID_WMSG         120
  29. #define ID_FMSG         121
  30.  
  31. #define ID_RMSG         140
  32. #define ID_WORD         141
  33. #define ID_VIRGIN       142
  34.  
  35. #define ID_FIRSTEDIT    ID_SUFS
  36. #define ID_LASTEDIT     ID_FMSG
  37.  
  38. /* General input dialog box */
  39. #define ID_INPUT        100
  40. #define ID_IMSG         101
  41.  
  42. /* ID's for my windows */
  43.  
  44. #define ID_USERWORDS    (WM_USER)
  45. #define ID_CPLAY        (WM_USER+1)
  46. #define ID_GT           (WM_USER+2)
  47. #define ID_PLIST        (WM_USER+3)
  48. #define ID_PROBOX       (WM_USER+4)
  49. #define ID_ENTER        (WM_USER+5)
  50. #define ID_STOP         (WM_USER+6)
  51.  
  52. #define ID_FIRSTCUBE    (WM_USER+8)
  53. /* must leave enough space for 25 cubes */
  54. #define ID_LASTCUBE     (WM_USER+33)
  55.  
  56. /* My own messages */
  57. #define EGGM_SET        (WM_USER+35)
  58. #define EGGM_START      (WM_USER+36)
  59. #define EGGM_STOP       (WM_USER+37)
  60. #define BAGOM_ENDGAME   (WM_USER+38)
  61. #define BAGOM_INIT      (WM_USER+39)
  62. #define BAGOM_CUBEDN    (WM_USER+40)
  63. #define BAGOM_CUBEUP    (WM_USER+41)
  64. #define BAGOM_TAB       (WM_USER+42)
  65.  
  66. #define PRO_INIT        (WM_USER+50)
  67. #define PRO_SETPOS      (WM_USER+51)
  68.  
  69. #define MN_DD_GAME      (WM_USER+100)
  70. #define MN_DD_OPTIONS   (WM_USER+200)
  71. #define MN_DD_DICT      (WM_USER+300)
  72. #define MN_DD_HELP      (WM_USER+400)
  73. #define MN_REWARDS      (WM_USER+500)
  74.  
  75. #define MN_SEL_0        0
  76. #define MN_SEL_1        1
  77. #define MN_SEL_2        2
  78. #define MN_SEL_3        3
  79. #define MN_SEL_4        4
  80. #define MN_SEL_5        5
  81. #define MN_SEL_6        6
  82. #define MN_SEL_7        7
  83. #define MN_SEL_8        8
  84. #define MN_SEL_9        9
  85.  
  86. /* Game menu */
  87. #define MN_GAM_PLAY     0
  88. #define MN_GAM_END      1
  89. #define MN_GAM_STATS    2
  90. #define MN_GAM_CSTATS   3
  91. #define MN_GAM_LOAD     4
  92. #define MN_GAM_SAVE     5
  93. #define MN_GAM_TOURN    6
  94. #define MN_GAM_QUIT     7
  95.  
  96. /* Option menu */
  97. #define MN_OPT_LEVEL    0
  98. #define MN_OPT_SOUND    1
  99. #define MN_OPT_GTIME    2
  100. #define MN_OPT_TIMER    3
  101. #define MN_OPT_LEARN    4
  102. #define MN_OPT_CPLAY    5
  103. #define MN_OPT_ROTATE   6
  104. #define MN_OPT_REWARDS  7
  105.  
  106. /* Dictionary menu */
  107. #define MN_DIC_LOAD     0
  108. #define MN_DIC_SAVE     1
  109. #define MN_DIC_SHOW     2
  110. #define MN_DIC_EDIT     3
  111. #define MN_DIC_OPT      4
  112. #define MN_DIC_CULL     5
  113. #define MN_DIC_RFREQ    6
  114.  
  115. /* Help menu */
  116. #define MN_HLP_REFCARD  0
  117. #define MN_HLP_INDEX    1
  118. #define MN_HLP_ABOUT    2
  119.  
  120. /* Resource numbers */
  121. #define STARBMP 100
  122. #define A0BMP   101
  123. #define B0BMP   102
  124. #define C0BMP   103
  125. #define D0BMP   104
  126. #define E0BMP   105
  127. #define F0BMP   106
  128. #define G0BMP   107
  129. #define H0BMP   108
  130. #define I0BMP   109
  131. #define J0BMP   110
  132. #define K0BMP   111
  133. #define L0BMP   112
  134. #define M0BMP   113
  135. #define N0BMP   114
  136. #define O0BMP   115
  137. #define P0BMP   116
  138. #define Q0BMP   117
  139. #define R0BMP   118
  140. #define S0BMP   119
  141. #define T0BMP   120
  142. #define U0BMP   121
  143. #define V0BMP   122
  144. #define W0BMP   123
  145. #define X0BMP   124
  146. #define Y0BMP   125
  147. #define Z0BMP   126
  148. #define A1BMP   127
  149. #define B1BMP   128
  150. #define C1BMP   129
  151. #define D1BMP   130
  152. #define E1BMP   131
  153. #define F1BMP   132
  154. #define G1BMP   133
  155. #define H1BMP   134
  156. #define I1BMP   135
  157. #define J1BMP   136
  158. #define K1BMP   137
  159. #define L1BMP   138
  160. #define M1BMP   139
  161. #define N1BMP   140
  162. #define O1BMP   141
  163. #define P1BMP   142
  164. #define Q1BMP   143
  165. #define R1BMP   144
  166. #define S1BMP   145
  167. #define T1BMP   146
  168. #define U1BMP   147
  169. #define V1BMP   148
  170. #define W1BMP   149
  171. #define X1BMP   150
  172. #define Y1BMP   151
  173. #define Z1BMP   152
  174. #define A2BMP   153
  175. #define B2BMP   154
  176. #define C2BMP   155
  177. #define D2BMP   156
  178. #define E2BMP   157
  179. #define F2BMP   158
  180. #define G2BMP   159
  181. #define H2BMP   160
  182. #define I2BMP   161
  183. #define J2BMP   162
  184. #define K2BMP   163
  185. #define L2BMP   164
  186. #define M2BMP   165
  187. #define N2BMP   166
  188. #define O2BMP   167
  189. #define P2BMP   168
  190. #define Q2BMP   169
  191. #define R2BMP   170
  192. #define S2BMP   171
  193. #define T2BMP   172
  194. #define U2BMP   173
  195. #define V2BMP   174
  196. #define W2BMP   175
  197. #define X2BMP   176
  198. #define Y2BMP   177
  199. #define Z2BMP   178
  200. #define A3BMP   179
  201. #define B3BMP   180
  202. #define C3BMP   181
  203. #define D3BMP   182
  204. #define E3BMP   183
  205. #define F3BMP   184
  206. #define G3BMP   185
  207. #define H3BMP   186
  208. #define I3BMP   187
  209. #define J3BMP   188
  210. #define K3BMP   189
  211. #define L3BMP   190
  212. #define M3BMP   191
  213. #define N3BMP   192
  214. #define O3BMP   193
  215. #define P3BMP   194
  216. #define Q3BMP   195
  217. #define R3BMP   196
  218. #define S3BMP   197
  219. #define T3BMP   198
  220. #define U3BMP   199
  221. #define V3BMP   200
  222. #define W3BMP   201
  223. #define X3BMP   202
  224. #define Y3BMP   203
  225. #define Z3BMP   204
  226.  
  227. #define UPBMP   300
  228. #define DOWNBMP 301
  229. #define EYESBMP 302
  230. #define ENTERUPBMP      303
  231. #define ENTERDNBMP      304
  232. #define STOPUPBMP       305
  233. #define STOPDNBMP       306
  234. #define SHADEBMP        307
  235. #define REWARD1BMP      309
  236. #define REWARD2BMP      310
  237. #define REWARD3BMP      311
  238. #define REWARD4BMP      312
  239.  
  240. #define BAGOCUR 400
  241.  
  242. #define BAGOICON        500
  243. #define BIKINIICON      501
  244.  
  245. #define BAGOMENU        600
  246. #define BAGOACCEL       601
  247.  
  248. #define ABOUTBOX        700
  249. #define INPUTDIALOG     701
  250. #define EDITWORDBOX     702
  251.  
  252. /* RGB values */
  253. #define  BLACK                (LONG)0x00000000
  254. #define  RED                  (LONG)0x000000FF
  255. #define  GREEN                (LONG)0x0000FF00
  256. #define  BLUE                 (LONG)0x00FF0000
  257. #define  YELLOW               (LONG)0x0000FFFF
  258. #define  MAGENTA              (LONG)0x00FF00FF
  259. #define  CYAN                 (LONG)0x00FFFF00
  260. #define  WHITE                (LONG)0x00FFFFFF
  261. #define  GRAY0                (LONG)0x00C0C0C0
  262. #define  GRAY1                (LONG)0x00808080
  263. #define  GRAY2                (LONG)0x00404040
  264.  
  265. #define  CR     0x0D
  266. #define  LF     0x0A
  267.  
  268. /* game related items */
  269. /* dimensions of board */
  270. #define NROWS   5
  271. #define NCOLS   5
  272. /* number of dice equals NROWS*NCOLS */
  273. #define NDICE  25
  274. #define NFACES  6     /* faces on a die */
  275. #define NORIENT 4     /* number of orientations of die face: upside-down, etc */
  276.  
  277. #define USERWORDLEN     1000    /* initial size of buffer for user words */
  278.  
  279. #define LINELEN         30      /* maximum string size */
  280.  
  281. #define BAGODIC     "BAGO.DIC"          /* the dictionary file */
  282. #define BAGOINI     "BAGO.INI"          /* init file */
  283. #define BAGONEW     "BAGO.NEW"          /* cull output file */
  284. #define BAGOSAVE    "BAGOSAVE.TXT"      /* default save file */
  285. #define BAGOHLP     "BAGO.HLP"          /* win format help file */
  286.  
  287. /* the playing board is an array of these records */
  288. typedef struct tagBOARD {
  289.     char val;  /* the character on top face of die */
  290.     char orient;  /* its orientation (0, 90, 180, 270 degree rotation) */
  291.     BOOL Cused;    /* true if die was used in trying to make a word */
  292.                   /* used only by computer in trying to find words */
  293.     BOOL Uused;   /* true if player used letter by pushing button in */
  294.     HWND hWindow;    /* handle of control corresponding to this die */
  295.     char r, c;          /* row and column of this die */
  296.     struct tagBOARD *link[8];  /* links to neighboring dice, some may be NULL */
  297.    } BOARD;
  298.  
  299. /* This record type defines a word in the program's dictionary.  It is one
  300.  * leaf of the dictionary tree.  Note that the links to other leaves are
  301.  * Windows memory handles, NOT pointers.
  302.  */
  303. typedef struct tagDW {
  304.     char w[10];         /* the word itself */
  305.     /* bits in the following are equal to 1 if the program knows how to apply */
  306.     /* a particular suffix to this word */
  307.     unsigned Suffix1;
  308.     HANDLE gt;          /* link to word after this in collating order */
  309.     HANDLE lt;          /* link to word before this one */
  310.     HANDLE up;          /* up link to superior leaf in tree */
  311.     int Freq;           /* incremented on each usage */
  312.    } DW;
  313.  
  314. /* This is sent to the InputBox upon initialization */
  315. typedef struct tagInputStruct {
  316.     LPSTR Prompt;
  317.     LPSTR OutString;
  318.     LPINT OutI;
  319.     BOOL IntMode;
  320.    } INPUTSTRUCT;
  321.  
  322. /* Sent to the Pic display window upon initialization */
  323. typedef struct tagPicStruct {
  324.     LPSTR PicMsg;
  325.     int PicNumber;      /* resource number of bitmap for display */
  326.    } PICSTRUCT;
  327.  
  328. typedef DW *PDW;        /* pointer to dictionary word structure */
  329. typedef DW FAR *LPDW;
  330. typedef INPUTSTRUCT FAR *LPINPUTSTRUCT;
  331. typedef PICSTRUCT FAR *LPPICSTRUCT;
  332.  
  333. /* This is used to pass a cube's coordinates in a single word */
  334. typedef struct tagCUBELOC {
  335.     char row;
  336.     char col;
  337.    } CUBELOC;
  338.  
  339. int PASCAL WinMain(HANDLE, HANDLE, LPSTR, int);
  340. BOOL BagoInit(HANDLE);
  341. int FAR PASCAL EnumFunc(LPLOGFONT, LPTEXTMETRIC, short, LPSTR);
  342. long FAR PASCAL BagoWndProc(HWND, unsigned, WORD, LONG);
  343. BOOL FAR PASCAL About(HWND, unsigned, WORD, LONG);
  344. BOOL FAR PASCAL EditWord(HWND, unsigned, WORD, LONG);
  345. long FAR PASCAL EggWndProc(HWND, unsigned, WORD, LONG);
  346. long FAR PASCAL ProWndProc(HWND, unsigned, WORD, LONG);
  347. long FAR PASCAL CubeWndProc(HWND, unsigned, WORD, LONG);
  348. long FAR PASCAL PicWndProc(HWND, unsigned, WORD, LONG);
  349. WORD InputBox(HWND, LPSTR, LPSTR, LPINT, BOOL);
  350. BOOL FAR PASCAL InputDiag(HWND, unsigned, WORD, LONG);
  351. unsigned GetButtons(HWND);
  352. int isword(char *);
  353. HWND CreateProBox(HWND);
  354. CreatePicBox(HWND, int, LPSTR);
  355. CUBELOC PopCube();
  356.